package com.funtester.seven.day3;

import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static com.funtester.seven.day3.Collect.output;

public class SetT {

    public static void main(String[] args) {
        JSONObject jsonObject = new JSONObject();
        Set<String> set = new HashSet<>();
        set.add("1");
        set.add("3");
        set.add("2");
        set.remove("1");
//        output(set.size());
//print(set);
        List<String> list = new ArrayList<>();
        list.add("4");
        list.add("3");
        list.add("2");
        list.add("3");
        Set<String> strings = new HashSet<>(list);
        print(strings);
        ArrayList<String> strings1 = new ArrayList<>(strings);
        output(strings1);

    }

    public static void print(Set set) {
        for (Object s : set) {
            output(s);
        }
    }
}
